namespace NFreeMarker.Template
{
    /**
     * Objects that will be interpreted as true/false in the appropriate
     * context must implement this interface.
     *
     * @version $Id: TemplateBooleanModel.java,v 1.8 2003/01/12 23:40:21 revusky Exp $
     */

    public static class TemplateBooleanModel
    {
        ///**
        // * A singleton object to represent boolean false
        // */
        public static ITemplateBooleanModel False = new TemplateBooleanModelFalse();

        /**
         * A singleton object to represent boolean true
         */
        public static ITemplateBooleanModel True = new TemplateBooleanModelTrue();

        internal class TemplateBooleanModelTrue : ITemplateBooleanModel
        {
            public bool GetAsBoolean()
            {
                return true;
            }
        }

        private class TemplateBooleanModelFalse : ITemplateBooleanModel
        {
            public bool GetAsBoolean()
            {
                return false;
            }
        }
    }
}